﻿using GrayParrot.ServiceBus;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace ConsoleApplication1
{
    public class TestSubscriber : GrayParrot.ServiceBus.Subscriber<TestSubscriber>
    {
        public TestSubscriber()
            : base("odds_notification")
        {
        }

        public override bool Receive(Microsoft.ServiceBus.Messaging.BrokeredMessage message)
        {
            bool retValue = false;

            MessageBusBase<BufferRemoveMessage> m_body = (MessageBusBase<BufferRemoveMessage>)message.GetBody<MessageBusBase<BufferRemoveMessage>>();

            BufferRemoveMessage m_msg = m_body.Body;

            Console.WriteLine("{0} {1}", m_msg.Palinsesto, m_msg.Avvenimento);

            retValue = true;

            return retValue;
        }
    }
}
